package com.cdd.goods.controller;

import com.cdd.goods.service.IGoodsBrandService;
import com.cdd.goods.service.IGoodsSpecificationService;
import com.common.entity.GoodsSpecification;
import com.common.untils.CommonResult;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzl
 * @since 2022-09-01
 */
@RestController
@RequestMapping("/goods/goodsSpecification")
public class GoodsSpecificationController {
    @Autowired
    private IGoodsSpecificationService iGoodsSpecificationService;
    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public CommonResult selectAll(@RequestBody GoodsSpecification goodsSpecification,@PathVariable Integer currentPage,@PathVariable Integer pageSize ){
        return iGoodsSpecificationService.selectAll(goodsSpecification,currentPage,pageSize);
    }
    @PostMapping("/select")
    public CommonResult select(){
        return iGoodsSpecificationService.select();
    }
    @PostMapping("/delectGoodsBrand/{id}")
    public CommonResult delectGoodsBrand(@PathVariable Integer id){
        return iGoodsSpecificationService.delectGoodsBrand(id);
    }
    @PostMapping("/updateGoodsBrand")
    public CommonResult updateGoodsBrand(@RequestBody GoodsSpecification goodsSpecification){
        return iGoodsSpecificationService.updateGoodsBrand(goodsSpecification);
    }
    @PostMapping("/insertGoods")
    public CommonResult insertGoods(@RequestBody GoodsSpecification goodsSpecification){
        return iGoodsSpecificationService.insertGoods(goodsSpecification);
    }
}
